# 闰年的条件：1. 能被4整除但是不能被100整除 2. 能被400整除 条件1和条件2 满足一个即可

def is_even(year):
    if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:
        return "闰年"
    else:
        return "平年"

def is_even_month(year, month):

    if month in [1, 3, 5,7,8,10,12]:
        return "31"
    elif month in [4,6,9,11]:
        return "30"
    else:
        if is_even(year) == "闰年":
            return "29"
        else:
            return "28"

def is_season(month):
    if month in [3,4,5]:
        return "春季"
    elif month in [6,7,8]:
        return "夏季"
    elif month in [9,10,11]:
        return "秋季"
    elif month in [12,1,2]:
        return "冬季"
    else:
        return "没有这个季节"


print(is_even(2020))
print(is_even_month(2020,2))
print(is_season(2))


# 注意：质数：在大于1的自然数中，除了1和它本身以外不再有其他因数的自然数。
def judge_quality(x):
    if type(x) == int:
        if x < 2:
            return False
        else:
            for n in range(2, x):
                if x % n == 0:
                    return False
            else:
                return True
    else:
        return False
p =  judge_quality(7)
print(p)

# 回文： 颠倒过来 与 自身数据一样的称为回文  例如 111  121  1221 12321
def is_huiwen(num):
    str_num = str(num)
    str_num = str_num[::-1]
    if str_num == str_num[::-1]:
        return "回文数"

print(is_huiwen(727))
